package com.xiangge.test;

import java.util.Arrays;
import java.util.Random;

public class Demo7 {
    public static void main(String[] args) {
        int[] moneys = {2, 588 , 888, 1000, 10000};
        int[] m2 = new int[moneys.length];
        for (int i = 0; i < moneys.length; i++) {
            while (true) {
                int j = new Random().nextInt(moneys.length-1+1);

                boolean flag = true;

                for (int y = 0; y < m2.length; y++) {
                    if (m2[y]==moneys[j]){
                        flag = false;
                        break;
                    }
                }
                if (flag){
                    m2[i] = moneys[j];
                    break;
                }
            }

        }
        System.out.println(Arrays.toString(m2));
        for (int i : m2) {
            System.out.println(i+"元的奖金被抽出");
        }
    }
}
